﻿Module ViewValidators
    Public Sub isInteger(ByVal e As System.Windows.Forms.KeyPressEventArgs)

        Select Case Asc(e.KeyChar)
            Case 4, 24, 4, 19, 127, 13, 9, 15, 14, 8
                Exit Sub
        End Select

        If IsNumeric(e.KeyChar) = False Then
            MsgBox("Este carater no está permitido ( " + e.KeyChar + " )", vbCritical, "Importante")
            e.KeyChar = ""
        End If

    End Sub

    Public Sub isFloat(ByVal e As System.Windows.Forms.KeyPressEventArgs)

        Select Case Asc(e.KeyChar)
            Case 4, 24, 4, 19, 127, 13, 9, 15, 14, 8, 44
                Exit Sub
        End Select

        If IsNumeric(e.KeyChar) = False Then
            MsgBox("Este carater no está permitido ( " + e.KeyChar + " )", vbCritical, "Importante")
            e.KeyChar = ""
        End If

    End Sub
End Module
